#!/bin/bash

export LC_ALL=C

GA_DIR=$1

GENE_ID=`head -n1 $GA_DIR/gene.faa | cut -b 2-`
GENE_FUNCTION=`cat $GA_DIR/../gene_functions.txt | grep $GENE_ID | cut -f2 | head -n1`

echo -ne $(basename $GA_DIR)

for E_DIR in $GA_DIR/e_*; do
    
    RES=`cat $E_DIR/results_gene_functions_best_uniq.txt \
        | cut -f2 | 6_annotation/compare_gene_functions.sh "$GENE_FUNCTION"`

    echo -ne '\t'$RES

done

echo -e '\t'$GENE_FUNCTION

